#ifndef __RADAR_LIST_ALARM_MODEL_INCLUDE__
#define __RADAR_LIST_ALARM_MODEL_INCLUDE__

#include <QObject>
#include <QVector>
#include <QAbstractTableModel>
#include "AlarmCellDef.h"

class WarnListModel : public QAbstractTableModel
{
    Q_OBJECT
public:
    explicit WarnListModel(QObject *parent = nullptr);

    void addRadarWarnItem(const UserRegionAlarmParam& cell);
    void clearAll();
    size_t  getRadarWarnItemCount() { return cells.size(); }
    UserRegionAlarmParam getRowData(int row, bool* isOk);

protected:
    QVariant data(const QModelIndex &index, int role) const;
    int rowCount(const QModelIndex &parent) const;
    int columnCount(const QModelIndex &parent) const;
    QVariant headerData(int section, Qt::Orientation orientation, int role) const;

private:
    QString AlarmMaskString(int mask) const;

private:
    QVector<UserRegionAlarmParam> cells;
    QStringList m_HorizontalHeader;
};
#endif
